import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:open_eye/base/controller/base_controller.dart';
import 'package:open_eye/base/pageWidget/base_stateless_widget.dart';
import 'package:open_eye/route/router_utils.dart';

class ViewStudy extends BaseStatelessWidget<ViewStudyController> {
  @override
  Widget buildContent(BuildContext context) {
    return NestedScrollView(
      body: Container(
        padding: EdgeInsets.fromLTRB(20.0, 100.0, 20.0, 20.0),
        child: Column(
          children: [
            ElevatedButton(
                onPressed: () {
                  RouterUtils.toImageFitTestPage();
                },
                child: Text("ImageFitTest")),
            TextButton(
              child: Text("TextButtom"),
              onPressed: () {
                showToast("点击了按钮");
              },
            ),
            OutlinedButton(onPressed: () {}, child: Text("normal")),
            IconButton(onPressed: () {}, icon: Icon(Icons.thumb_up)),
            ElevatedButton.icon(
                onPressed: () {}, icon: Icon(Icons.send), label: Text("发送")),
            TextButton.icon(
                onPressed: () {}, icon: Icon(Icons.add), label: Text("添加")),
            OutlinedButton.icon(
                onPressed: () {}, icon: Icon(Icons.info), label: Text("详情")),
            Image.asset(
              "assets/images/head_mine.jpeg",
              width: 100.0,
            ),
            Image.network(
              "https://avatars2.githubusercontent.com/u/20411648?s=460&v=4",
              width: 200.0,
            ),
            Padding(padding: EdgeInsets.all(20.0)),
          ],
        ),
      ),
      headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            title: Text("复仇者联盟"),
            expandedHeight: 230.0,
            pinned: true,
            flexibleSpace: FlexibleSpaceBar(
              title: Text(""),
              background: Image.network(
                'http://img.haote.com/upload/20180918/2018091815372344164.jpg',
                fit: BoxFit.fitHeight,
              ),
            ),
          )
        ];
      },
    );
  }

  @override
  String titleString() {
    return "View学习";
  }

  @override
  bool showTitleBar() {
    return false;
  }

  @override
  bool useLoadSir() => false;
}

class ViewStudyController extends BaseController {
  @override
  void loadNet() {
    // TODO: implement loadNet
  }
}
